{extend name="default/template/base_index" /}

{block name="area_header"}
    <link rel="stylesheet" type="text/css" media="all" href="__CSS__/wxshop.css">
    <link type="text/css" rel="stylesheet" src="__CDN__/jquery-uploadify/3.2.1/uploadify.css"/>
    <script type="text/javascript" src="__CDN__/jquery-uploadify/3.2.1/jquery.uploadify.min.js"></script>
    <script type="text/javascript" src="__CDN__/jquery-uploadify/3.2.1/jquery.uploadify.min.js"></script>

{/block}

{block name="area_body"}
{include file="default/Widget/topbar" /}
<div class="admin-main container-fluid">
    {include file="default/Widget/left" /}
    <div class="admin-main-content">
        {include file="default/Widget/breadcrumb" /}
        <div class="table-responsive well">
            <!-- 过滤\查询按钮 -->
                <form action="{:url('Repairer/edit')}" class="j_member_edit_form form-horizontal" method="post">
                    <input type="hidden" value="{$user.id}" name="id" />
                    <!-- 操作按钮 -->
                    <div class="form-group">
                        <label class="col-md-2 col-lg-2 control-label">&nbsp;</label>
                        <div class="col-md-10 col-lg-10">
                            <a href="{:url('Admin/Member/index')}" class="btn btn-sm btn-default" >返回</a>
                            <a href="{:url('Admin/Member/edit')}" onclick="return getData();"  class="btn btn-sm btn-primary ajax-post" target-form="j_member_edit_form">保存</a>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 col-lg-2 control-label">头像</label>
                        <div class="col-md-10 col-lg-10">
                            <input type="hidden" name="head" value="{$user.head}" class="j_head_val" />
                            <div class=" clearfix">
                                <div class="col-lg-10 col-md-10">
                                    <!-- 图片选择DOM结构 -->
                                    <div class="wxuploaderimg clearfix j_head "  data-maxitems="1">
                                        <div class="img-preview clearfix"  style="display:inline-block;" >
                                            <div class="pull-left clearfix img-item">
                                                <img src="{:app\\src\\base\\helper\\ConfigHelper::getAvatarUrl($user['id'],60)}" alt="image" data-imageid="{$user['head']}"/>
                                                <div class="edit_pic_wrp"><a href="javascript:;" class="fa fa-lg fa-trash js_delete"></a></div>
                                            </div>
                                        </div>
                                        <div class="add"  style="display:none;" >
                                            <i class="fa fa-plus"></i>
                                        </div>
                                    </div>
                                    <!-- 图片选择DOM结构 --><span class="text-muted">(建议尺寸为480像素*480像素，大小不超过300kb)</span>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 col-lg-2 control-label">用户昵称</label>
                        <div class="col-md-10 col-lg-10">
                            <input type="text" class="form-control" value="{$user.nickname}" name="nickname" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 col-lg-2 control-label">用户邮箱</label>
                        <div class="col-md-10 col-lg-10">
                            <input type="text" class="form-control" value="{$user.email}" name="email" />
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 col-lg-2 control-label">性别</label>
                        <div class="col-md-10 col-lg-10">
                            <label class="radio-inline">
                                <input type="radio" {eq name="$user.sex" value="0" }checked{/eq} name="sex"  value="0"> 女
                            </label>
                            <label class="radio-inline">
                                <input type="radio" {eq name="$user.sex" value="1"}checked{/eq}  name="sex"  value="1"> 男
                            </label>
                        </div>
                    </div>


                    <div class="form-group">
                        <label class="col-md-2 col-lg-2 control-label">用户姓名</label>
                        <div class="col-md-10 col-lg-10">
                            <input type="text" class="form-control" value="{$user.realname}" name="realname" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 col-lg-2 control-label">用户身份证号</label>
                        <div class="col-md-10 col-lg-10">
                            <input type="text" class="form-control" value="{$user.idnumber}" name="idnumber" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 col-lg-2 control-label">个性签名</label>
                        <div class="col-md-10 col-lg-10">
                            <textarea rows="5" class="form-control"  name="sign" >{$user.sign}</textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 col-lg-2 control-label">可同时登录设备数量</label>
                        <div class="col-md-10 col-lg-10">
                            <input type="text" class="form-control" value="{$user.login_device_cnt}" name="login_device_cnt" />
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 col-lg-2 control-label">&nbsp;</label>
                        <div class="col-md-10 col-lg-10">
                            <a href="{:url('Admin/Member/index')}" class="btn btn-sm btn-default" >返回</a>
                            <a href="{:url('Admin/Member/edit')}" onclick="return getData();" class="btn btn-sm btn-primary ajax-post" target-form="j_member_edit_form">保存</a>
                        </div>
                    </div>

                </form>
        </div>
    </div>
    <!-- END admin-main-content -->
    {include file="default/template/wxpicture"/}
</div>
<!-- END admin-main-->
{/block}

{block name="area_footer"}
    <script type="text/javascript">
    function getData() {
        console.log("getdata");
        var head = $(".j_head .img-preview img").attr("data-imageid");
        if (head) {
            $(".j_head_val").val(head);
        }
        return false;
    }
    $(function () {

        //图片上传
        wxuploadimg.init({cont:".wxuploaderimg"});
    })
    </script>
{/block}
